package com.woniu.darryringmall.front.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.darryringmall.front.entity.Cart;
import com.woniu.darryringmall.front.entity.CartVo;
import com.woniu.darryringmall.front.mapper.CartMapper;
import com.woniu.darryringmall.front.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 购物车Service实现
 */
@Service
public class CartServiceImpl extends ServiceImpl<CartMapper,Cart> implements CartService {
    @Autowired
    private CartMapper cartMapper;

    @Override
    public List<CartVo> carts(int userId) {
        return cartMapper.carts(userId);
    }

    @Override
    public void add(Cart cart) {
        cartMapper.add(cart);
    }

    @Override
    public void delete(int id) {
        cartMapper.deleteById(id);
    }

}
